<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>库存列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="resources/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="resources/css/public.css" media="all" />
</head>
<body class="childrenBody">
<form class="layui-form">
    <blockquote class="layui-elem-quote quoteBox">
        <form class="layui-form">
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input type="text" class="layui-input searchVal" placeholder="请输入搜索的内容" />
                </div>
                <a class="layui-btn search_btn" data-type="reload">搜索</a>
            </div>
        </form>
    </blockquote>
    <table id="basicDataList" lay-filter="basicDataList"></table>
    <!--操作-->
    <script type="text/html" id="basicDataLostListBar">
        <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delete">删除</a>
    </script>
</form>
<script type="text/javascript" src="resources/layui/layui.js"></script>
<script th:inline="none">
    layui.use(['form','layer','laydate','table','laytpl'],function() {
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laydate = layui.laydate,
            laytpl = layui.laytpl,
            table = layui.table;
        //新闻列表
        var tableIns = table.render({
            elem: '#basicDataList',
            url: 'storages',
            cellMinWidth: 95,
            page: true,//分页
            height: "full-125",
            limit: 5,
            limits: [5, 10, 15, 20, 25],
            id: "basicDataListTable",
            cols: [[
                {type: "checkbox", fixed: "left", width: 50},//复选框
                {field: 'storNo', title: '序号', width: 100, align: "center"},
                {field: 'product', title: '产品',width:150, align:"center",templet:function (row) {
                        return row.product.prodName;
                    }},
                {field: 'product', title: '型号',width:150, align:"center",templet:function (row) {
                        return row.product.prodType;
                    }},
                {field: 'product', title: '级别',width:150, align:"center",templet:function (row) {
                        return row.product.prodGardeBatch;
                    }},
                {field: 'storStorehouse', title: '仓库', width: 250, align: "center"},
                {field: 'storLocation', title: '货位', width: 250, align: "center"},
                {field: 'storCount', title: '件数', width: 250, align: "center"},
                {field: 'storRemark', title: '备注', width: 250, align: "center"}
            ]]
        });
        //搜索
        $(".search_btn").on("click",function(){
            table.reload("basicDataListTable",{
                page: {
                    curr: 1 //重新从第 1 页开始
                },
                where: {
                    storRemark:$(".searchVal").val()
                }
            })
        });

    })
</script>
</body>
</html>